package cn.tedu.bean;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;

@Configuration
public class ConfigBean {
    /**
     * 使用@Bean显式创建Java Bean
     */
    //@Bean("aaa")可以自定义BeanId
    @Bean
    public ArrayList<String> list() {
        ArrayList<String> list = new ArrayList<>();
        list.add("Tom");
        list.add("Jack");
        return list;
    }

    @Bean
    public ArrayList<String> mobilePhone() {
        ArrayList<String> list = new ArrayList<>();
        list.add("110");
        list.add("120");
        list.add("119");
        return list;
    }

    @Bean
    public Person person() {
        Person person = new Person("张三", 18, "男");
        return person;
    }
}
